// JavaScript Document
var adWidth="100px";
var adHeight="250px";
var adImg1="images/ad2.jpg";
var close_img1="images/close.png";

var adBtn=document.createElement("div");
adBtn.style.width=adWidth;
adBtn.style.height=adHeight;
adBtn.style.padding="0px";
adBtn.style.position="absolute";
adBtn.style.right="250px";
adBtn.style.bottom="20px";

var ad_img=document.createElement("img");
ad_img.src=adImg1;
adBtn.appendChild(ad_img);

var closeimg1=document.createElement("img");
closeimg1.src=close_img1;
closeimg1.style.width="50px";
closeimg1.style.position="relative";
closeimg1.style.left="250px";
closeimg1.style.top="-250px";
closeimg1.style.cursor="pointer";
adBtn.appendChild(closeimg1);

document.documentElement.appendChild(adBtn);

closeimg1.addEventListener("click",function(){
	adBtn.style.display="none";
});

window.addEventListener("scroll",function(){
	var str3=document.documentElement.scrollTop||document.body.scrollTop;
	adBtn.style.top=(str3+502)+"px";
});